#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f3f3f3f3f;

void solve()
{
    string s;
    cin >> s;
    cout << fixed << setprecision(15);
    double ans = 0.00;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == 't')
        {
            for (int j = i + 1; j < s.size(); j++)
            {
                if (s[j] == 't')
                {
                    int cnt = 0;
                    for (int k = i; k <= j; k++)
                    {
                        cnt += s[k] == 't';
                    }
                    ans = max(ans, (cnt - 2) / (double)(j - i + 1 - 2));
                }
            }
        }
    }
    cout << ans << endl;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    //cin >> _;
    while (_--)
    {
        solve();
    }
    return 0;
}